package com.cbgolf.oa.presenter;

import com.cbgolf.oa.contract.IMessageCenterContract.IMessageCenterModel;
import com.cbgolf.oa.contract.IMessageCenterContract.IMessageCenterPresenter;
import com.cbgolf.oa.contract.IMessageCenterContract.IMessageCenterView;
import com.cbgolf.oa.model.MessageCenterModelImp;
import com.cbgolf.oa.util.DataUtil;

/**
 * @author lq
 */
public class MessageCenterPresenterImp implements IMessageCenterPresenter {

  private IMessageCenterView view;
  private IMessageCenterModel model;

  public MessageCenterPresenterImp(IMessageCenterView view) {
    this.view = view;
    model = new MessageCenterModelImp();
  }

  @Override
  public void requestData(int requestType) {
    if (requestType == DataUtil.INITDATA) {
      view.showProgress();
    }
    model.requestData(requestType);
  }

  @Override
  public void readMsg(String id) {
    model.readMsg(id);
  }
}
